home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_4.adf / Compiler_Headers / Include / resources / disk.h < prev    next >
C/C++ Source or Header  |  1992-07-30  |  3KB  |  126 lines

  1. #ifndef    RESOURCES_DISK_H
  2. #define RESOURCES_DISK_H
  3. /*
  4. **    $Filename: resources/disk.h $
  5. **    $Release: 2.04 Includes, V37.4 $
  6. **    $Revision: 27.11 $
  7. **    $Date: 90/11/21 $
  8. **
  9. **    disk.h -- external declarations for the disk resource
  10. **
  11. **    (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef    EXEC_TYPES_H
  16. #include "exec/types.h"
  17. #endif
  18.  
  19. #ifndef    EXEC_LISTS_H
  20. #include "exec/lists.h"
  21. #endif
  22.  
  23. #ifndef    EXEC_PORTS_H
  24. #include "exec/ports.h"
  25. #endif
  26.  
  27. #ifndef    EXEC_INTERRUPTS_H
  28. #include "exec/interrupts.h"
  29. #endif
  30.  
  31. #ifndef    EXEC_LIBRARIES_H
  32. #include "exec/libraries.h"
  33. #endif
  34.  
  35.  
  36. /********************************************************************
  37. *
  38. * Resource structures
  39. *
  40. ********************************************************************/
  41.  
  42.  
  43. struct DiscResourceUnit {
  44.     struct Message dru_Message;
  45.     struct Interrupt dru_DiscBlock;
  46.     struct Interrupt dru_DiscSync;
  47.     struct Interrupt dru_Index;
  48. };
  49.  
  50. struct DiscResource {
  51.     struct Library        dr_Library;
  52.     struct DiscResourceUnit    *dr_Current;
  53.     UBYTE            dr_Flags;
  54.     UBYTE            dr_pad;
  55.     struct Library        *dr_SysLib;
  56.     struct Library        *dr_CiaResource;
  57.     ULONG            dr_UnitID[4];
  58.     struct List        dr_Waiting;
  59.     struct Interrupt        dr_DiscBlock;
  60.     struct Interrupt        dr_DiscSync;
  61.     struct Interrupt        dr_Index;
  62.     struct Task            *dr_CurrTask;
  63. };
  64.  
  65. /* dr_Flags entries */
  66. #define DRB_ALLOC0    0    /* unit zero is allocated */
  67. #define DRB_ALLOC1    1    /* unit one is allocated */
  68. #define DRB_ALLOC2    2    /* unit two is allocated */
  69. #define DRB_ALLOC3    3    /* unit three is allocated */
  70. #define DRB_ACTIVE    7    /* is the disc currently busy? */
  71.  
  72. #define DRF_ALLOC0    (1<<0)    /* unit zero is allocated */
  73. #define DRF_ALLOC1    (1<<1)    /* unit one is allocated */
  74. #define DRF_ALLOC2    (1<<2)    /* unit two is allocated */
  75. #define DRF_ALLOC3    (1<<3)    /* unit three is allocated */
  76. #define DRF_ACTIVE    (1<<7)    /* is the disc currently busy? */
  77.  
  78.  
  79.  
  80. /********************************************************************
  81. *
  82. * Hardware Magic
  83. *
  84. ********************************************************************/
  85.  
  86.  
  87. #define    DSKDMAOFF    0x4000    /* idle command for dsklen register */
  88.  
  89.  
  90. /********************************************************************
  91. *
  92. * Resource specific commands
  93. *
  94. ********************************************************************/
  95.  
  96. /*
  97.  * DISKNAME is a generic macro to get the name of the resource.
  98.  * This way if the name is ever changed you will pick up the
  99.  *  change automatically.
  100.  */
  101.  
  102. #define DISKNAME    "disk.resource"
  103.  
  104.  
  105. #define    DR_ALLOCUNIT    (LIB_BASE - 0*LIB_VECTSIZE)
  106. #define    DR_FREEUNIT    (LIB_BASE - 1*LIB_VECTSIZE)
  107. #define    DR_GETUNIT    (LIB_BASE - 2*LIB_VECTSIZE)
  108. #define    DR_GIVEUNIT    (LIB_BASE - 3*LIB_VECTSIZE)
  109. #define    DR_GETUNITID    (LIB_BASE - 4*LIB_VECTSIZE)
  110. #define    DR_READUNITID    (LIB_BASE - 5*LIB_VECTSIZE)
  111.  
  112. #define    DR_LASTCOMM    (DR_READUNITID)
  113.  
  114. /********************************************************************
  115. *
  116. * drive types
  117. *
  118. ********************************************************************/
  119.  
  120. #define    DRT_AMIGA    (0x00000000)
  121. #define    DRT_37422D2S    (0x55555555)
  122. #define DRT_EMPTY    (0xFFFFFFFF)
  123. #define DRT_150RPM    (0xAAAAAAAA)
  124.  
  125. #endif /* RESOURCES_DISK_H */
  126.